EventLog Class and Machine Name (Connecting to remote machine eventlog). | 您所在的位置:网站首页 › class eventlog › EventLog Class and Machine Name (Connecting to remote machine eventlog). |
Hi all, I am trying to write to an EventLog on a remote machine and am getting an IOException stating "Network path not found". Now the computer name I am referencing can indeed be found and if I type a computer name such as "BLABLA" it takes forever to return however if I type in the computer name that is in my domain it returns almost instantly as if the computer is found but reports the above error. Also, I am able to connect to the remote computer's EventLog using my current credentials (I.E. not specifying a different user) through the Vista Event Viewer and "Connect to another machine" without any problem. Any ideas on why I am unable to connect to the same machine name but through the EventLog Class? Any help much appreciated. :) Here is some of the code I am working with: if (!EventLog.Exists("Application", "REMOTEMACHINENAME")) //Exception here or any time I use an EventLog method that tries to reference the remote machine. { EventSourceCreationData srcData = new EventSourceCreationData("Taicho", "TaichoLog"); srcData.MachineName = "REMOTEMACHINENAME"; EventLog.CreateEventSource(srcData); } EventLog log = new EventLog("TaichoLog", "REMOTEMACHINENAME","Taicho"); log.WriteEntry("Taicho says hi from his computer", EventLogEntryType.Information); |
CopyRight 2018-2019 实验室设备网 版权所有 |